package jgcp.worker.process;

import jgcp.common.Task;
/**
 * 
 * @Date 31/05/2009
 * @author Peng Zhang(278819) Jie Zhao (288654)
 * @version 1.0
 */
public class ExecutionThread extends Thread {
	public ExecutionThread() {
		setDaemon(true);
	}

	public void run() {
		while (true) {
			try {
				Task t = TaskQueue.getInstance().take();
				System.out.println("Got Task:" + t.getTaskid());
				Executer exe = new Executer(t);
				TaskList.getInstance().store(t, exe);
				exe.start();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
